#include "LCG.h"

LCGrng::LCGrng(unsigned int seed){
	this->seed = seed;
	a = 1103515245;
	c = 12345;
	m = 0x80000000;
}

unsigned int LCGrng::getNext(){
	seed = (a * seed + c) % m;
	return seed;
}

unsigned int LCGrng::getNext(int min , int max){
	seed = (a * seed + c) % m;
	return seed%(max - min +1) + min;
}